
# import time
# import background 

# @background.task
# def work():
#     # Do something expensive here.
#     sleep
#     time.sleep(1)

# print(" CPU for BG Thread :",background.default_n())


# for x in range(100):
#     print(" worker :",x )
#     work()

import asyncio
import aioredis


async def go():
    conn = await aioredis.create_connection(
        ('localhost', 6379), loop=loop)
    await conn.execute('set', 'my-key', 'value')
    val = await conn.execute('get', 'my-key')
    print(val)
    conn.close()
    await conn.wait_closed()
# loop = asyncio.get_event_loop()
# loop.run_until_complete(go())

from aiohttp import web

async def hello(request):
    return web.Response(text="Hello, world")

app = web.Application()
app.router.add_get('/', hello)

web.run_app(app)
